package ${f.pkg};

<#list f.imports as imps>
import ${imps};
</#list>


/**
 *	EntityFields (${f.e.tableName})
 *  ${f.e.tableDesc!""}
 *
 *	@author ${f.e.author!""} (${f.e.authorEnglish!""})
 *	@date ${f.e.createTime}
 */
public class ${f.className} implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

<#list f.fields as field>
    /**
     *  ${field.desc!""}
     */
    public static String ${field.upHumpName} = "${field.columnName}";
</#list>


    /**
     *  本次查询涉及的字段名
     */
    protected List<String> fields;
    public List<String> getFields() {
        return fields;
    }
    public void setFields(List<String> fields) {
        this.fields = fields;
    }
    /**
     *  全部字段
     */
    public static ${f.className} All() {
        ${f.className} f = new ${f.className}();
        List<String> fields = new ArrayList<>();
        <#list f.fields as field>
            fields.add(${f.className}.${field.upHumpName});
        </#list>
        f.fields = fields;
        return f;
    }
    <#list f.fields as field>
    /**
     *  追加 ${field.columnName}
     */
    public static ${f.className} ${field.upHumpName}() {
        return new ${f.className}().${field.name}();
    }
    public ${f.className} ${field.name}() {
        if (fields == null) {fields = new ArrayList<>();}
        fields.add(${f.className}.${field.upHumpName});
        return this;
    }
    </#list>
}